工作内容 = {
	游戏逻辑实现 = {
		后端抽象、数据、逻辑梳理
		战斗状态流程梳理
	}
	网络 = {
		epoll
	}
	数据结构	= {
		跳跃表
	}
	接入mysql客户端
}

game 抽象 = {
	server = {
		Server = {
			propertys = {
				std::map<int, Player> users_
			}
			funcs = {
				Player* CreateUser(std::string name)
				void JoinBattle(Player* player, int opponent_player_id, int battle_id)
				{
					opponent_player
					if (GetPlayer(opponent_player_id))
						return
					battle = opponent_player->GetBattle()
					if (!battle)
						return
					if (check wait ready state)
						battle->EnterPlayer(player)
					else
					{
						Battle* battle = GetWaitBattle()
						if (battle)
							battle->EnterPlayer(player)
					}
				}
				Battle* GetWaitBattle()
				Player* GetPlayer(int player_id)
			}
		}
		Player = {
			propertys = {
				char state_ // idle; waiting opponent; playing
				std::string name_
				Battle* battle_
				int player_id_
			}
			funcs = {
				void OnEnterBattle()
				{
					// notify to client
				}
				void OnStartFight()
				{
					notify to client
				}
				void SetState(char state)
				void ChangeScore(int score)
			}
		}
		BattleManager = {
			propertys = {
				std::map<int, Battle*> waiting_battles_
				std::map<int, Battle*> fighting_battles_
			}
			funcs = {
				Battle* CreateBattle(Player* player)
				{
					create battle
					battle->EnterPlayer(player)
					-- waiting_battles_
				}
			}
		}
		Battle = {
			propertys = {
				char state_ // init; wait ready; fight; end
				char fight_result_ // 1 player_1_ win; 2 player_2_ win
				int created_player_id_
				Player* player_1_
				Player* player_2_
			}
			funcs = {
				bool EnterPlayer(Player* player)
				{
					if (!player_1_)
					{
						player_1_ = player
						player_1_->SetState(wait opponent state)
					}
					else
					{
						player_2_ = player
					}
					
					if (check is all ready to fight)
						StartFight()
				}
				bool LeavePlayer(Player* player)
				{
					players_ SetState(idle)
				}
				void StartFight()
				{
					change to fight state
					player_1_->SetState(playing)
					player_2_->SetState(playing)
				}
				void Update()
				void FinishFight()
				{
					players LeavePlayer()
					SettleBattle()
				}
				void SettleBattle()
				{

				}
			}
		}
	}
	client = {
		commands = {
			help
			login = {name}
			list
			creatb 
			joinb 
			exit
		}
		GameRun = {
			funcs = {
				void Update()
			}
		}
		Player = {
			propertys = {
				char online_state_  // offline; online
				char game_state_ // offline; idle; waiting opponent; playing
				int player_id_
			}
			funcs = {
				OnStartGame() = {
					please enter you name
				}
				void HandleInput() = {
					if (game_state_ == offline)
				}
			}
		}
		Battle = {
			propertys = {
				char online_state_  // offline; online
				char game_state_ // offline; idle; waiting opponent; playing
				int player_id_
			}
			funcs = {
				OnStartGame() = {
					please enter you name
				}
				void HandleInput() = {
					if (game_state_ == offline)
				}
			}
		}
	}
}

Protocols = {
	CSLogin

}

网络抽象 = {

}